home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!Alun.Champion
- From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
- Newsgroups: comp.lang.c++
- Subject: Re: Creating a pointer to a function "void (*ptrFunction)()" inside a class
- Date: 09 Jan 1996 20:21:02 GMT
- Organization: Computer People Inc.
- Message-ID: <ALUN.CHAMPION.96Jan9152102@g7240065.bridge.bst.bls.com>
- References: <30ECA10F.3D99@ifu.net> <NITIN.96Jan5125830@more.eng.sun.com>
- <4crquj$7t1@lib108.its.rpi.edu> <NITIN.96Jan9103242@more.eng.sun.com>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
- In-reply-to: nitin@more.eng.sun.com's message of 09 Jan 1996 18:32:42 GMT
-
- In article <NITIN.96Jan9103242@more.eng.sun.com> nitin@more.eng.sun.com (Nitin More [CONTRACTOR]) writes:
-
- : In article <4crquj$7t1@lib108.its.rpi.edu> floydb1@lib108.its.rpi.edu (Barry B Floyd) writes:
-
- : [original message deleted]
- : [text deleted]
-
- : > note: "Function ( int, int )" remains virtual in DerivedClass,
- : > even though the keyword "virtual" is not included in the declaration.
- : > Thus, I believe "class DerivedDerivedClass : DerivedClass" must provide
- : > a "Function ( int, int )" as well.
-
- : I believe the last paragraph is wrong. Somebody please correct me if I am
- : wrong.
-
- : (1) The "Function ( int, int )" *does not* remain virtual in DerivedClass
- : unless the keyword "virtual" is included in the declaration.
-
- I am afraid it does remain virtual.
-
- [excerpt from standard]
- 10.3 Virtual Functions
- ...
- 2 If a virtual member function vf is declared in a class Base and in a class
- Derived, derived directly or indirectly from Base, a member function vf with
- the same name and same parameter list as Base::vf is declared, then
- Derived::vf is also virtual (whether or not it is so declared) and it
- overrides Base::vf. ...
- ...
-
- : (2) The "class DerivedDerivedClass : DerivedClass" *does not* have to provide
- : a "Function ( int, int )" as well as long as one of its derived classes
- : has provided definition for the pure virtual function.
-
- Correct. It does remain virtual but it is no longer pure because of the
- implementation in DerivedClass.
-
- Hope this helps
- Regards
-
- -A.
- --
- | A.Champion |
-